# -*- coding:utf8 -*-
F:\software\Python36\python.exe D:/PythonAppium/case/test_case.py
already connected to 127.0.0.1:21503
0
already connected to 127.0.0.1:21513
0
�ɹ�: ����ֹ���� "node.exe"���� PID Ϊ 7560��
�ɹ�: ����ֹ���� "node.exe"���� PID Ϊ 7436��
[Appium] Welcome to Appium v1.11.1
[Appium] Non-default server args:
[Appium]   port: 4700
[Appium]   bootstrapPort: 4900
[Appium]   udid: 127.0.0.1:21503
[Appium] Deprecated server args:
[Appium]   -U,--udid => --default-capabilities '{"udid":"127.0.0.1:21503"}'
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium]   udid: 127.0.0.1:21503
[Appium] Welcome to Appium v1.11.1
[Appium] Non-default server args:
[Appium]   port: 4701
[Appium]   bootstrapPort: 4901
[Appium]   udid: 127.0.0.1:21513
[Appium] Deprecated server args:
[Appium]   -U,--udid => --default-capabilities '{"udid":"127.0.0.1:21513"}'
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium]   udid: 127.0.0.1:21513
[Appium] Appium REST http interface listener started on 0.0.0.0:4700
[Appium] Appium REST http interface listener started on 0.0.0.0:4701
get_suit 里边的parame是 0
this is setUpClass-----> 0
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"firstMatch":[{"platformName":"Android","appium:deviceName":"127.0.0.1:21503","appium:app":"D:\\PythonAppium\\mukewang.apk","appium:appPackage":"cn.com.open.mooc","appium:appActivity":"cn.com.open.mooc.index.splash.MCSplashActivity","appium:noReset":true}]},"desiredCapabilities":{"platformName":"Android","deviceName":"127.0.0.1:21503","app":"D:\\PythonAppium\\mukewang.apk","appPackage":"cn.com.open.mooc","appActivity":"cn.com.open.mooc.index.splash.MCSplashActivity","noReset":true}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","deviceName":"127.0.0.1:21503","app":"D:\\PythonAppium\\mukewang.apk","appPackage":"cn.com.open.mooc","appActivity":"cn.com.open.mooc.index.splash.MCSplashActivity","noReset":true},null,{"firstMatch":[{"platformName":"Android","appium:deviceName":"127.0.0.1:21503","appium:app":"D:\\PythonAppium\\mukewang.apk","appium:appPackage":"cn.com.open.mooc","appium:appActivity":"cn.com.open.mooc.index.splash.MCSplashActivity","appium:noReset":true}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1550902526269 (14:15:26 GMT+0800 (GMT+08:00))
[BaseDriver] The capabilities ["udid"] are not standard capabilities and should have an extension prefix
[Appium] DeprecationWarning: 'automationName' capability was not provided. Future versions of Appium will require 'automationName' capability to be set for Android sessions.
[Appium] Setting automation to 'UiAutomator1'.
[Appium] Creating new AndroidDriver (v4.8.0) session
[Appium] Capabilities:
[Appium]   platformName: Android
[Appium]   udid: 127.0.0.1:21503
[Appium]   deviceName: 127.0.0.1:21503
[Appium]   app: D:\PythonAppium\mukewang.apk
[Appium]   appPackage: cn.com.open.mooc
[Appium]   appActivity: cn.com.open.mooc.index.splash.MCSplashActivity
[Appium]   noReset: true
[debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"udid":"127.0.0.1:21503","... were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa...
[BaseDriver] Session created with session id: cb84eb61-b35d-40da-b282-472d1d1cd820
(node:7644) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[AndroidDriver] Java version is: 1.8.0_201
[ADB] Checking whether adb is present
[ADB] Found 1 'build-tools' folders under 'C:\Program Files\Java\adt\sdk' (newest first):
[ADB]     C:/Program Files/Java/adt/sdk/build-tools/android-4.4W
[ADB] Using adb.exe from C:\Program Files\Java\adt\sdk\platform-tools\adb.exe
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
get_suit 里边的parame是 1
this is setUpClass-----> 1
[HTTP] --> POST /wd/hub/session
[HTTP] {"capabilities":{"firstMatch":[{"platformName":"Android","appium:deviceName":"127.0.0.1:21513","appium:app":"D:\\PythonAppium\\mukewang.apk","appium:appPackage":"cn.com.open.mooc","appium:appActivity":"cn.com.open.mooc.index.splash.MCSplashActivity","appium:noReset":true}]},"desiredCapabilities":{"platformName":"Android","deviceName":"127.0.0.1:21513","app":"D:\\PythonAppium\\mukewang.apk","appPackage":"cn.com.open.mooc","appActivity":"cn.com.open.mooc.index.splash.MCSplashActivity","noReset":true}}
[debug] [W3C] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","deviceName":"127.0.0.1:21513","app":"D:\\PythonAppium\\mukewang.apk","appPackage":"cn.com.open.mooc","appActivity":"cn.com.open.mooc.index.splash.MCSplashActivity","noReset":true},null,{"firstMatch":[{"platformName":"Android","appium:deviceName":"127.0.0.1:21513","appium:app":"D:\\PythonAppium\\mukewang.apk","appium:appPackage":"cn.com.open.mooc","appium:appActivity":"cn.com.open.mooc.index.splash.MCSplashActivity","appium:noReset":true}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1550902528293 (14:15:28 GMT+0800 (GMT+08:00))
[BaseDriver] The capabilities ["udid"] are not standard capabilities and should have an extension prefix
[Appium] DeprecationWarning: 'automationName' capability was not provided. Future versions of Appium will require 'automationName' capability to be set for Android sessions.
[Appium] Setting automation to 'UiAutomator1'.
[Appium] Creating new AndroidDriver (v4.8.0) session
[Appium] Capabilities:
[Appium]   platformName: Android
[Appium]   udid: 127.0.0.1:21513
[Appium]   deviceName: 127.0.0.1:21513
[Appium]   app: D:\PythonAppium\mukewang.apk
[Appium]   appPackage: cn.com.open.mooc
[Appium]   appActivity: cn.com.open.mooc.index.splash.MCSplashActivity
[Appium]   noReset: true
[debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"udid":"127.0.0.1:21513","... were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa...
[BaseDriver] Session created with session id: 1cf331b9-b434-4f81-834f-967beb6e1558
(node:7084) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[AndroidDriver] Java version is: 1.8.0_201
[ADB] Checking whether adb is present
[ADB] Found 1 'build-tools' folders under 'C:\Program Files\Java\adt\sdk' (newest first):
[ADB]     C:/Program Files/Java/adt/sdk/build-tools/android-4.4W
[ADB] Using adb.exe from C:\Program Files\Java\adt\sdk\platform-tools\adb.exe
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[ADB] Error killing ADB server, going to see if it's online anyway
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Getting connected devices...
[debug] [ADB] 0 device(s) connected
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn't active
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1550902555626 (14:15:55 GMT+0800 (GMT+08:00))
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [W3C] Encountered internal error running command: Error: Could not find a connected Android device.
[debug] [W3C]     at getDevices (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules\_appium-adb@7.2.0@appium-adb\lib\tools\system-calls.js:195:13)
[debug] [W3C]     at getDevices (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules\_appium-adb@7.2.0@appium-adb\lib\tools\system-calls.js:212:20)
[HTTP] <-- POST /wd/hub/session 500 29394 ms - 715
[HTTP]
E
======================================================================
ERROR: setUpClass (__main__.Test_case)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:/PythonAppium/case/test_case.py", line 29, in setUpClass
    cls.login_business = LoginBusiness(parames)
  File "D:\PythonAppium\business\login_business.py", line 12, in __init__
    self.login_handle = LoginhHandle(i)
  File "D:\PythonAppium\handle\login_handle.py", line 12, in __init__
    self.login_page = Login_Page(i)
  File "D:\PythonAppium\page\login_page.py", line 22, in __init__
    self.driver = base_driver.android_driver(i)
  File "D:\PythonAppium\base\base_driver.py", line 27, in android_driver
    driver = webdriver.Remote("http://127.0.0.1:"+port+"/wd/hub", capabilities)
  File "F:\software\Python36\lib\site-packages\appium_python_client-0.36-py3.6.egg\appium\webdriver\webdriver.py", line 118, in __init__
    super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
  File "F:\software\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "F:\software\Python36\lib\site-packages\appium_python_client-0.36-py3.6.egg\appium\webdriver\webdriver.py", line 159, in start_session
    response = self.execute(RemoteCommand.NEW_SESSION, parameters)
  File "F:\software\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "F:\software\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not find a connected Android device.


----------------------------------------------------------------------
Ran 0 tests in 29.445s

FAILED (errors=1)
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [ADB] Could not find devices, restarting adb server...
[debug] [ADB] Restarting adb
[debug] [ADB] Killing adb server on port 5037
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn't active
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1550902559398 (14:15:59 GMT+0800 (GMT+08:00))
[debug] [W3C] Encountered internal error running command: Error: Could not find a connected Android device.
[debug] [W3C]     at getDevices (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules\_appium-adb@7.2.0@appium-adb\lib\tools\system-calls.js:195:13)
[debug] [W3C]     at getDevices (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules\_appium-adb@7.2.0@appium-adb\lib\tools\system-calls.js:212:20)
E
======================================================================
ERROR: setUpClass (__main__.Test_case)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:/PythonAppium/case/test_case.py", line 29, in setUpClass
    cls.login_business = LoginBusiness(parames)
  File "D:\PythonAppium\business\login_business.py", line 12, in __init__
    self.login_handle = LoginhHandle(i)
  File "D:\PythonAppium\handle\login_handle.py", line 12, in __init__
    self.login_page = Login_Page(i)
  File "D:\PythonAppium\page\login_page.py", line 22, in __init__
    self.driver = base_driver.android_driver(i)
  File "D:\PythonAppium\base\base_driver.py", line 27, in android_driver
    driver = webdriver.Remote("http://127.0.0.1:"+port+"/wd/hub", capabilities)
  File "F:\software\Python36\lib\site-packages\appium_python_client-0.36-py3.6.egg\appium\webdriver\webdriver.py", line 118, in __init__
    super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
  File "F:\software\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "F:\software\Python36\lib\site-packages\appium_python_client-0.36-py3.6.egg\appium\webdriver\webdriver.py", line 159, in start_session
    response = self.execute(RemoteCommand.NEW_SESSION, parameters)
  File "F:\software\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "F:\software\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not find a connected Android device.


----------------------------------------------------------------------
Ran 0 tests in 31.226s

FAILED (errors=1)
[HTTP] <-- POST /wd/hub/session 500 31155 ms - 715
[HTTP]
